<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="author" content="zhupeng">
		<TITLE>卡片库存查询明细</TITLE>
		<script language="javascript" src="../script/common.js" type="text/javascript"></script>
		<script language="javascript" type="text/javascript">
			//全局变量
			var org = Common.cOrg();	//当前单位	
			var qt = {};				//数据表格对象
			//页面加载方法
			function load(){ 
				Eui.showNavigation();
				searchForm.orgId.value = org.id;
				searchForm.orgName.value = org.name
				Common.initDict(searchForm.cardStatus,CardStore.getStoreStatus(),"全 部");
				
			 	//初始化卡片状态
			 	var storeStatus = Common.getSubsetItems(CardStoreStatus.CATEGORY, [CardStoreStatus.MANUFACTURE, CardStoreStatus.STORE, CardStoreStatus.ONPASSAGE, CardStoreStatus.LOST, CardStoreStatus.DAMAGED]);
	 			Common.initDict("storeStatus",storeStatus,"全 部");
				
				createTable();		
			}
			//较验时间
			function checkDate(){
				if(!checkForm(searchForm))return;
				var beginAsn = searchForm.beginAsn.value
				var endAsn = searchForm.endAsn.value
				if(beginAsn=="" && endAsn!=""){
					showInformation("请输入起始卡号!");return false;
				}else if(beginAsn!="" && endAsn==""){
					showInformation("请输入结束卡号!");return false;
				}
				qt.showTable();	
			}
			//生成表格，创建QueryTable对象(查询)
			function createTable(){
				var columns = [];
				columns[0] = {type:"checkbox"}
				columns[1] = {defOrder:"asc"}
				qt = new QueryTable("card_inventory","searchForm","datalist",columns);
			}
			function selCardType(){			
				var v = openDialogFrame("/basic/card_type_list.html?",'请选择卡片类型',464,700)
				if (v){
					searchForm.cardTypeName.value = v[1]; 	 
				}
			}
			function selCard(){			
				var v = openDialogFrame("/store/sel_white_list.html?",'请选择卡片规格',464,700)
				if (v){
					searchForm.cardSpecName.value = v.name; 	 
				}
			}
			//选择机构方法
			function setOrg(sorg) {
				searchForm.orgName.value = sorg.name;
			    $("orgId").value = sorg.id;
			}
		
		</script>
	</head>
<body onload="load()">
	<!--页面导航-->
	<div class="nav"><div id="nav">&nbsp;</div></div>
	<!--查询静态页面部分-->
	<div id="listview" >	
		<!--查询条件form-->
		<div class="searchForm">
			<form id="searchForm" name="searchForm">
				<input type="hidden" id="cardBillId" name="cardBillId" />
				<input type="hidden" id="orgId" name="orgId">	
				<table cellSpacing=0 cellPadding=4 width="100%" border=0>
					<tr>
						<td><label>卡片类型</label> <input type="text" name="cardTypeName" ><a class="orga" title="请选择卡片类型" href="javascript:void(0)" onclick="selCardType()">&nbsp;&nbsp;</a></td>	
						<td><label>卡片规格</label> <input type="text" name="cardSpecName" ><a class="orga" title="选择卡片规格" href="javascript:void(0)" onclick="selCard()">&nbsp;&nbsp;</a></td>
						<td><label>库存状态</label> <select name="storeStatus"></select>
					</tr>
					<tr>
						<td><label>卡片状态</label> <select name="cardStatus"></select>
						<td><label>起始卡号</label> <input type="text"  name="beginAsn"  onblur="if(checkDubleObjs(searchForm.beginAsn,searchForm.endAsn,'asn','asn'))compareValue(searchForm.beginAsn,searchForm.endAsn,'ge','起始卡号','结束卡号');" maxlength="16" ></td>
						<td><label>结束卡号</label> <input type="text"  name="endAsn" onblur="if(checkDubleObjs(searchForm.beginAsn,searchForm.endAsn,'asn','asn'))compareValue(searchForm.beginAsn,searchForm.endAsn,'ge','起始卡号','结束卡号');" maxlength="16" ></td>
						
					</tr>	
					<tr>
						<td><label>机构名称</label> <input type="text" name="orgName" class="readonly"> <a class="orga" href="#" onclick="SystemMgnt.selOrg(setOrg);">&nbsp;&nbsp;</a></td>
						<td>&nbsp;</td>
						<td><button type="button" onclick="checkDate()">查 询</button></td>
					</tr>
				</table>
			</form>
		</div>
		<div id=datalist></div>	
	</div>
</body>
</HTML>